package com.shisan.tingshu.search.rpc;

import com.shisan.tingshu.common.result.Result;
import com.shisan.tingshu.search.service.ItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RequestMapping("/api/inner/searchinfo")
@RestController
public class SearchInfoRpcController {

    @Autowired
    private ItemService itemService;


    @PutMapping("/preRankingToCache")
    Result<Boolean> preRankingToCache() {

        try {
            itemService.preRankingToCache();
            return Result.ok(true);
        } catch (Exception e) {
            return Result.ok(false);
        }
    }
}
